package com.itheima.text6;

import java.util.concurrent.CountDownLatch;

public class Chile2 extends Thread {

    private CountDownLatch countDownLatch;

    public Chile2(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        for (int i = 1; i <= 15; i++) {
            System.out.println(getName()+"在吃第"+i+"个饺子");
        }

        //运行结束 提示
        //每一次countDown方法的时候，就让计数器-1
        countDownLatch.countDown();
    }
}
